{% extends "main.html" %}

{% block title %}{{ _("Blog") }}{% end %}

{% block tagsblock %}
{% for tag in tags_arr %}
        <a href="/blog/search/tags?tag={{ tag['_id'] }}">{{ tag['_id'] }}</a>
{% end %}
{% end %}

{% block body %}
<div>
	{% for post in posts %}
		<div class="post">
			<div><strong>
				{{ post['author'] }} : 
				<a href="/blog/postview/{{ post['_id'] }}">{{ post['title'] }}</a>
				( {{ locale.format_date(post['time'], full_format=True, shorter=False) }} )
			</strong></div>
			<div>{{ post['postcontentshort'] }}</div>
			<div><small>
                {% for tag in post['tags'] %}<a href="/blog/search/tags?tag={{ tag }}">{{ tag }}</a> {% end %}
            </small></div>
			<div>
				<a href="/blog/edit/{{ post['_id'] }}">{{ _("Edit") }}</a>
				<a href="/blog/edit/{{ post['_id'] }}?mode=delpost">{{ _("Delete") }}</a>
			</div>
		</div>
	{% end %}
</div>
{% end %}